package com.koron.css2;


import com.koron.util.InitParam;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * 项目全局配置
 *
 * @author 许海宜
 * 2019年9月25日
 */
@Component
@PropertySource(value = "classpath:application-${spring.profiles.active}.properties", encoding = "UTF-8", ignoreResourceNotFound = false)
public class ApplicationConfig {

    public static final String ADD_APP_URL = "/permissionController/addApp.htm";

    public static final String QUERY_APP_URL = "/permissionController/queryApp.htm";

    public static final String ADD_OPERATE_URL = "/permissionController/addOperate.htm";

    public static final String ADD_ROLE_OPERATE_URL = "/permissionController/addRoleOP.htm";

    public static final String UPDATE_OPERATE_URL = "/permissionController/updateOperate.htm";

    public static final String DELETE_OPERATE_URL = "/permissionController/deleteOperate.htm";

    public static final String GET_USER_OPT_LIST = "/permissionController/getUserOPList.htm";

    public static final String DELETE_ROLE_OPERATE = "/permissionController/deleteRoleOP.htm";

    public static final String ADD_ROLE_URL = "/permissionController/addRole.htm";

    public static final String ADD_ROLE_USER_URL = "/permissionController/addRoleUser.htm";

    public static final String DEL_ROLE_URL = "/permissionController/deleteRole.htm";

    public static final String QUERY_ROLE_URL = "/permissionController/queryAllRole.htm";

    public static final String ADD_ROLE_ORG_URL = "/permissionController/addRoleOrg.htm";

    public static final String DEL_ROLE_ORG_URL = "/permissionController/deleteRoleOrg.htm";

    public static final String QUERY_USER_ROLE_URL = "/permissionController/getUserRoleList.htm";

    public static final String ADD_APP_CATA = "/permissionController/addAppCatalogue.htm";

    public static final String QUERY_APP_CATA = "/permissionController/queryAppCatalogue.htm";

    public static final String GET_USER_RANGE = "/permissionController/getUserRangeValueList.htm";

    public static final String ADD_ROLE_RANGE = "/permissionController/addRoleRangeValue.htm";

    public static final String QUERY_RANGE_ROLE = "/permissionController/queryRangeByRole.htm";

    public static final String QUERY_USER_ROLE = "/permissionController/queryUserByRole.htm";

    //private static final String

    //统一权限营业收费运维平台
    public static String appMaintainAppid;
    public static String appMaintainSecret;
    //#统一权限营业收费
    public static String appCustomerAppid;
    public static String appCustomerSecret;
    //#统一权限营收服务分析平台
    public static String appAnalysisAppid;
    public static String appAnalysisSecret;
    //#环境地址
    public static String appDevUrl;
    public static String appProdUrl;

    //#营收收费前端url
    public static String appcustomerfontUrl;
    //#分析平台前端url
    public static String appAnalysisfontUrl;
    //#流程平台url
    public static String workflowUrl;

    //附件上传url
    public static String accessoryUploadUrl;

    public static String accessoryAppId;

    public static String accessorySecret;

    public static String workflowAppCode;

    public static String workflowSecret;

    public static String authorityUrl;

    public static String authorityNewUrl;

    public static String authorityTenantCode;

    private static Integer expireTime;

    private static String env;

    private static String appSSOUrl;

    private static String appTokenUrl;

    private static String loginOutUrl;

    private static String workflowSSOUrl;

    //过滤掉的集团总部code
    private static String waterCodeFilter;

    //权限平台公钥
    private static String authorityPublicKey;

    // 权限平台 客服营业code
    private static String authorityAppCode;

    // 权限平台 应用版本CODE
    private static String appVersionCode;

    // 权限平台 角色类别CODE
    private static String authorityRoleCategoryCode;

    private static String authorityMenuUrl;

    private static String authorityRoleUrl;

    private static String uploadTempDir;
    private static String fileLocalPath;
    private static String oracleUrl;
    private static String oracleUsername;
    private static String oraclePassword;

    private static String authorityPlatform;
    private static String jcUrl;

    private static String quartzPrefix;

    private static Integer version = 2;

    private static String ljfInterface;

    private static String governmentHallWebsite;

    /**竹云单点登录配置****/
    /**
     * 竹云获取 token 接口地址
     */
    private static String iamTokenUrl;

    /**
     * 竹云获取 用户信息 接口地址
     */
    private static String iamUserUrl;

    /**
     * 竹云获取 登录地址 接口地址
     */
    private static String iamLoginUrl;

    /**
     * 竹云获取 退出登录 接口地址
     */
    private static String iamLoginoutUrl;

    /**
     * 单点登录平台 1 UMA 2 竹云
     */
    private static String ssoPlatform;

    /**
     * 竹云访问秘钥
     */
    private static String iamSecret;

    /**
     * ip白名单（网厅访问接口用）
     */
    private static String whiteIp;

    public static String getIamSecret() {
        return iamSecret;
    }

    @Value("${white.ip}")
    public void setWhiteIp(String whiteIp) {
        ApplicationConfig.whiteIp = whiteIp;
    }

    public static String getWhiteIp() {
        return whiteIp;
    }

    @Value("${iam.secret}")
    public void setIamSecret(String iamSecret) {
        ApplicationConfig.iamSecret = iamSecret;
    }

    public static String getSsoPlatform() {
        return ssoPlatform;
    }

    @Value("${sso.platform}")
    public void setSsoPlatform(String ssoPlatform) {
        ApplicationConfig.ssoPlatform = ssoPlatform;
    }

    public static String getIamTokenUrl() {
        return iamTokenUrl;
    }

    @Value("${iam.token.url}")
    public void setIamTokenUrl(String iamTokenUrl) {
        ApplicationConfig.iamTokenUrl = iamTokenUrl;
    }

    public static String getIamUserUrl() {
        return iamUserUrl;
    }

    @Value("${iam.user.url}")
    public void setIamUserUrl(String iamUserUrl) {
        ApplicationConfig.iamUserUrl = iamUserUrl;
    }

    public static String getIamLoginUrl() {
        return iamLoginUrl;
    }

    @Value("${iam.login.url}")
    public void setIamLoginUrl(String iamLoginUrl) {
        ApplicationConfig.iamLoginUrl = iamLoginUrl;
    }

    public static String getIamLoginoutUrl() {
        return iamLoginoutUrl;
    }

    @Value("${iam.loginout.url}")
    public void setIamLoginoutUrl(String iamLoginoutUrl) {
        ApplicationConfig.iamLoginoutUrl = iamLoginoutUrl;
    }

    public static String getGovernmentHallWebsite() {
        return governmentHallWebsite;
    }

    @Value("${government.hall.website}")
    public void setGovernmentHallWebsite(String governmentHallWebsite) {
        ApplicationConfig.governmentHallWebsite = governmentHallWebsite;
    }

    public static Integer getVersion() {
        return version;
    }

    public static void setVersion(Integer version) {
        ApplicationConfig.version = version;
    }

    public static String getQuartzPrefix() {
        return quartzPrefix;
    }

    public static String getLjfInterface() {
        return ljfInterface;
    }

    @Value("${ljfInterface.url}")
    public void setLjfInterface(String ljfInterface) {
        ApplicationConfig.ljfInterface = ljfInterface;
    }

    public static String getJcUrl() {
		return jcUrl;
	}
    @Value("${jc.prod.url}")
	public  void setJcUrl(String jcUrl) {
		ApplicationConfig.jcUrl = jcUrl;
	}

	public static String getUploadTempDir() {
		return uploadTempDir;
	}

    public static String getAuthorityPlatform() {
		return authorityPlatform;
	}


    public static String getAuthorityNewUrl() {
		return authorityNewUrl;
	}

    @Value("${app.authority.new.url}")
	public void setAuthorityNewUrl(String authorityNewUrl) {
		ApplicationConfig.authorityNewUrl = authorityNewUrl;
	}

	@Value("${app.authority.platform}")
	public void setAuthorityPlatform(String authorityPlatform) {
		ApplicationConfig.authorityPlatform = authorityPlatform;
	}



	@Value("${app.upload.uploadTempDir}")
	public void setUploadTempDir(String uploadTempDir) {
		ApplicationConfig.uploadTempDir = uploadTempDir;
	}

    public static String getAuthorityMenuUrl() {
		return authorityMenuUrl;
	}

	public static String getAuthorityRoleUrl() {
		return authorityRoleUrl;
	}

	@Value("${app.authority.menu.url}")
	public void setAuthorityMenuUrl(String authorityMenuUrl) {
		ApplicationConfig.authorityMenuUrl = authorityMenuUrl;
	}

    public static String getFileLocalPath() {
        return fileLocalPath;
    }

    public static String getOracleUrl() {
        return oracleUrl;
    }
    public static String getOracleUsername() {
        return oracleUsername;
    }
    public static String getOraclePassword() {
        return oraclePassword;
    }

    @Value("${app.upload.fileLocalPath}")
    public void setFileLocalPath(String fileLocalPath) {
        ApplicationConfig.fileLocalPath = fileLocalPath;
    }

    @Value("${oracle.oracleUrl}")
    public void setOracleUrl(String oracleUrl) {
        ApplicationConfig.oracleUrl = oracleUrl;
    }
    @Value("${oracle.oracleUsername}")
    public void setOracleUsername(String oracleUsername) {
        ApplicationConfig.oracleUsername = oracleUsername;
    }
    @Value("${oracle.oraclePassword}")
    public void setOraclePassword(String oraclePassword) {
        ApplicationConfig.oraclePassword = oraclePassword;
    }

	@Value("${app.authority.role.url}")
	public void setAuthorityRoleUrl(String authorityRoleUrl) {
		ApplicationConfig.authorityRoleUrl = authorityRoleUrl;
	}

	public static String getAuthorityRoleCategoryCode() {
		return authorityRoleCategoryCode;
	}

	@Value("${app.authority.role.category.code}")
	public void setAuthorityRoleCategoryCode(String authorityRoleCategoryCode) {
		ApplicationConfig.authorityRoleCategoryCode = authorityRoleCategoryCode;
	}

	public static String getAppVersionCode() {
		return appVersionCode;
	}

    @Value("${app.authority.version.code}")
	public void setAppVersionCode(String appVersionCode) {
		ApplicationConfig.appVersionCode = appVersionCode;
	}

	public static String getAuthorityPublicKey() {
		return authorityPublicKey;
	}

    @Value("${app.authority.public.key}")
	public void setAuthorityPublicKey(String authorityPublicKey) {
		ApplicationConfig.authorityPublicKey = authorityPublicKey;
	}

	public static String getAuthorityAppCode() {
		return authorityAppCode;
	}

    @Value("${app.authority.code}")
	public void setAuthorityAppCode(String authorityAppCode) {
		ApplicationConfig.authorityAppCode = authorityAppCode;
	}

    //过滤掉的集团总部code
    public static String getWaterCodeFilter() {
        return waterCodeFilter;
    }

    @Value("${waterCode.filter}")
    public  void setWaterCodeFilter(String waterCodeFilter) {
        ApplicationConfig.waterCodeFilter = waterCodeFilter;
    }


    public static String getWorkflowSSOUrl() {
        return workflowSSOUrl;
    }



    @Value("${workflow.sso.url}")
    public void setWorkflowSSOUrl(String workflowSSOUrl) {
        ApplicationConfig.workflowSSOUrl = workflowSSOUrl;
    }

    public static String getLoginOutUrl() {
        return loginOutUrl;
    }

    @Value("${cas.server.logout.url}")
    public void setLoginOutUrl(String loginOutUrl) {
        ApplicationConfig.loginOutUrl = loginOutUrl;
    }

    public static String getAppSSOUrl() {
        return appSSOUrl;
    }

    public static String getAppTokenUrl() {
        return appTokenUrl;
    }

    @Value("${app.sso.url}")
    public void setAppSSOUrl(String appSSOUrl) {
        ApplicationConfig.appSSOUrl = appSSOUrl;
    }

    @Value("${app.token.url}")
    public void setAppTokenUrl(String appTokenUrl) {
        ApplicationConfig.appTokenUrl = appTokenUrl;
    }

    public static String getEnv() {
        return env;
    }

    @Value("${spring.profiles.active}")
    public void setEnv(String env) {
        ApplicationConfig.env = env;
    }

    public static Integer getExpireTime() {
        return expireTime;
    }

    @Value("${app.expire.time}")
    public void setExpireTime(Integer expireTime) {
        ApplicationConfig.expireTime = expireTime;
    }

    public static String getAuthorityTenantCode() {
        return authorityTenantCode;
    }

    @Value("${app.authority.tenant.code}")
    public void setAuthorityTenantCode(String authorityTenantCode) {
        ApplicationConfig.authorityTenantCode = authorityTenantCode;
    }

    public static String getWorkflowAppCode() {
        return workflowAppCode;
    }

    public static String getWorkflowSecret() {
        return workflowSecret;
    }

    public static String getAuthorityUrl() {
        return authorityUrl;
    }

    @Value("${app.authority.url}")
    public void setAuthorityUrl(String authorityUrl) {
        ApplicationConfig.authorityUrl = authorityUrl;
    }

    @Value("${workflow.appCode}")
    public void setWorkflowAppCode(String workflowAppCode) {
        ApplicationConfig.workflowAppCode = workflowAppCode;
    }

    @Value("${workflow.secret}")
    public void setWorkflowSecret(String workflowSecret) {
        ApplicationConfig.workflowSecret = workflowSecret;
    }

    public static String getAccessoryAppId() {
        return accessoryAppId;
    }

    public static String getAccessorySecret() {
        return accessorySecret;
    }

    @Value("${accessory.upload.appid}")
    public void setAccessoryAppId(String accessoryAppId) {
        ApplicationConfig.accessoryAppId = accessoryAppId;
    }

    @Value("${accessory.upload.secret}")
    public void setAccessorySecret(String accessorySecret) {
        ApplicationConfig.accessorySecret = accessorySecret;
    }

    /**
     * 创建水司需要复制数据的表名
     */
    private static String copyTableNames;

    public static String getAccessoryDownloadUrl() {
        //2021-04-16 许，中转为https
        return (InitParam.isDev == false ? ApplicationConfig.getAppProdUrl() : ApplicationConfig.getAppDevUrl()) + "/relay.htm?fileServicePath=" + accessoryUploadUrl;
    }

    public static String getAccessoryUploadUrl() {
        return accessoryUploadUrl;
    }

    @Value("${accessory.upload.url}")
    public void setAccessoryUploadUrl(String accessoryUploadUrl) {
        ApplicationConfig.accessoryUploadUrl = accessoryUploadUrl;
    }

    public static String getWorkflowUrl() {
        return workflowUrl;
    }

    @Value("${workflow.url}")
    public void setWorkflowUrl(String workflowUrl) {
        ApplicationConfig.workflowUrl = workflowUrl;
    }

    public static String getAppMaintainAppid() {
        return appMaintainAppid;
    }

    @Value("${app.maintain.appid}")
    public void setAppMaintainAppid(String appMaintainAppid) {
        ApplicationConfig.appMaintainAppid = appMaintainAppid;
    }

    public static String getAppMaintainSecret() {
        return appMaintainSecret;
    }

    @Value("${app.maintain.secret}")
    public void setAppMaintainSecret(String appMaintainSecret) {
        ApplicationConfig.appMaintainSecret = appMaintainSecret;
    }

    public static String getAppCustomerAppid() {
        return appCustomerAppid;
    }

    @Value("${app.customer.appid}")
    public void setAppCustomerAppid(String appCustomerAppid) {
        ApplicationConfig.appCustomerAppid = appCustomerAppid;
    }

    public static String getAppCustomerSecret() {
        return appCustomerSecret;
    }

    @Value("${app.customer.secret}")
    public void setAppCustomerSecret(String appCustomerSecret) {
        ApplicationConfig.appCustomerSecret = appCustomerSecret;
    }

    public static String getAppAnalysisAppid() {
        return appAnalysisAppid;
    }

    @Value("${app.analysis.appid}")
    public void setAppAnalysisAppid(String appAnalysisAppid) {
        ApplicationConfig.appAnalysisAppid = appAnalysisAppid;
    }

    public static String getAppAnalysisSecret() {
        return appAnalysisSecret;
    }

    @Value("${app.analysis.secret}")
    public void setAppAnalysisSecret(String appAnalysisSecret) {
        ApplicationConfig.appAnalysisSecret = appAnalysisSecret;
    }

    public static String getAppcustomerfontUrl() {
        return appcustomerfontUrl;
    }

    @Value("${app.customer.fontUrl}")
    public void setAppcustomerfontUrl(String appcustomerfontUrl) {
        ApplicationConfig.appcustomerfontUrl = appcustomerfontUrl;
    }

    public static String getAppAnalysisfontUrl() {
        return appAnalysisfontUrl;
    }

    @Value("${app.analysis.fontUrl}")
    public void setAppAnalysisfontUrl(String appAnalysisfontUrl) {
        ApplicationConfig.appAnalysisfontUrl = appAnalysisfontUrl;
    }

    public static String getCopyTableNames() {
        return ApplicationConfig.copyTableNames;
    }

    @Value("${createWater.copyTableNames}")
    public void setCopyTableNames(String copyTableNames) {
        ApplicationConfig.copyTableNames = copyTableNames;
    }

    public static String getAppDevUrl() {
        return appDevUrl;
    }

    @Value("${app.dev.url}")
    public void setAppDevUrl(String appDevUrl) {
        ApplicationConfig.appDevUrl = appDevUrl;
    }

    public static String getAppProdUrl() {
        return appProdUrl;
    }

    @Value("${app.prod.url}")
    public void setAppProdUrl(String appProdUrl) {
        ApplicationConfig.appProdUrl = appProdUrl;
    }

    /**
     * 政务服务接口前缀地址
     */
    public static String govServicesPrefUrl;

    @Value("${gov.services.pref.url}")
    public void setGovServicesPrefUrl(String govServicesPrefUrl) {
        ApplicationConfig.govServicesPrefUrl = govServicesPrefUrl;
    }

    /**
     * 政务服务接口前缀地址
     */
    public static String govServicesAppId;

    @Value("${gov.services.appId}")
    public void setGovServicesAppId(String govServicesAppId) {
        ApplicationConfig.govServicesAppId = govServicesAppId;
    }

    /**
     * 政务服务接口前缀地址
     */
    public static String govServicesKey;

    @Value("${gov.services.key}")
    public void setGovServicesKey(String govServicesKey) {
        ApplicationConfig.govServicesKey = govServicesKey;
    }

    /**
     * 政务服务本系统所属id
     */
    public static String govServicesSystemId;

    @Value("${gov.services.systemId}")
    public void setGovServicesSystemId(String govServicesSystemId) {
        ApplicationConfig.govServicesSystemId = govServicesSystemId;
    }

    /**
     * 电子签章平台调用地址
     */
    public static String eleContractUrl;
    @Value("${eleContract.url}")
    public void setEleContractUrl(String eleContractUrl) {
        ApplicationConfig.eleContractUrl = eleContractUrl;
    }

    public static String eleContractAccessKey;
    @Value("${eleContract.access.key}")
    public void setEleContractAccessKey(String eleContractAccessKey) {
        ApplicationConfig.eleContractAccessKey = eleContractAccessKey;
    }

    public static String eleContractAccessSecret;
    @Value("${eleContract.access.secret}")
    public void setEleContractAccessSecret(String eleContractAccessSecret) {
        ApplicationConfig.eleContractAccessSecret = eleContractAccessSecret;
    }

    /**
     * 私有云电子签章平台调用地址
     */
    public static String privateEcUrl;
    @Value("${private.ec.url}")
    public void setPrivateEcUrl(String privateEcUrl) {
        ApplicationConfig.privateEcUrl = privateEcUrl;
    }

    /**
     * 私有云电子签章平台调用token
     */
    public static String privateEcToken;
    @Value("${private.ec.token}")
    public void setPrivateEcToken(String privateEcToken) {
        ApplicationConfig.privateEcToken = privateEcToken;
    }

    /**
     * 私有云电子签章平台调用secret
     */
    public static String privateEcSecret;
    @Value("${private.ec.secret}")
    public void setPrivateEcSecret(String privateEcSecret) {
        ApplicationConfig.privateEcSecret = privateEcSecret;
    }
}
